﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace UI.Forms
{
    /// <summary>
    /// 业务员销售交易汇总列表
    /// </summary>
    public partial class ProductSaleList_ByEmp : FormBase1
    {
        public ProductSaleList_ByEmp()
        {
            InitializeComponent();
        }

        private void opencardList_Load(object sender, EventArgs e)
        {
            BindingList<SVC.client.View_Emp_lite> emps=my.bw.View_Emp_lite_List("",my.ACID);
            dateselect1.lue_date.Properties.DataSource = my.dts;

            dateselect1.lue_date.EditValue = 1;
        }

        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_search_Click(object sender, EventArgs e)
        {
            BindData();
        }

        private void BindData()
        {
            DateTime? sd = null;
            DateTime? ed = null;
            if (dateselect1.de_sd.EditValue != null)
            { sd = dateselect1.de_sd.DateTime; }
            if (dateselect1.de_ed.EditValue != null)
            { ed = dateselect1.de_ed.DateTime; }

            gridControl1.DataSource = my.bw.Get_ProductSale_ByEmpResult(sd, ed, my.ACID);
        }

        /// <summary>
        /// 清除条件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_Clean_Click(object sender, EventArgs e)
        {
            dateselect1.de_sd.EditValue = dateselect1.de_ed.EditValue = null;
            BindData();
        }

        private void gridView1_RowClick(object sender, DevExpress.XtraGrid.Views.Grid.RowClickEventArgs e)
        {
            if (e.RowHandle>=0)
            {
            }
        }
    }
}